﻿using Levfier.Proccessors.Parameters;

namespace Levfier.Proccessors.Filters
{
    /// <summary>
    /// ローシェルフィングフィルター（IIR）
    /// </summary>
    abstract public class ShelfIIR : IIR
    {
        /// <summary>
        /// ゲインパラメータ
        /// </summary>
        protected ProccessParameter gainParam;

        /// <summary>
        /// 係数を初期化する
        /// </summary>
        /// <param name="sender">イベント発生元</param>
        abstract protected override void InitFilterCoefficient(object sender);

        /// <summary>
        /// パラメータの初期化を行う
        /// </summary>
        protected override void InitParameters()
        {
            this.gainParam = new ProccessParameter();
            this.gainParam.Name = "Gain[dB]";
            this.gainParam.Value = 0.0d;
            this.gainParam.MaxValue = 20.0d;
            this.gainParam.MinValue = -20.0d;
            this.gainParam.Step = 1.0d;
            this.parameters.Add(this.gainParam.Name, this.gainParam);
            this.gainParam.ValueChanged += this.InitFilterCoefficient;

            base.InitParameters();
        }
    }
}
